package gui.admin;


import javax.swing.*;
import java.awt.*;

public class RegisterWin extends JFrame {
    JPanel j0,j1,j2,j3,j4,j5,j6;
    JLabel l0,l1,l2,l3,l4,l5;

    JTextField t_id;
    JTextField t_name;
    JTextField t_phone;
    JComboBox<String> t2;

    JPasswordField t4,t5;
    JButton b1,b2;

    public RegisterWin(){
        init();
        setTitle("读者注册");
        setSize(400,320);
        setLocationRelativeTo(null);    //窗口居中
        setVisible(true);
        setResizable(false);    //禁用用户调整界面大小
    }

    private void init() {
        //布局管理器将JPanel容器分成6行1列的网格
        setLayout(new GridLayout(7,1));

        j0=new JPanel();
        l0 =new JLabel("身份证号");
        t_id =new JTextField(15);
        j0.add(l0);
        j0.add(t_id);
        add(j0);

        j1=new JPanel();
        l1=new JLabel("你的姓名");
        t_name =new JTextField(15);
        j1.add(l1);
        j1.add(t_name);
        add(j1);

        j2=new JPanel();
        l2=new JLabel("你的性别");
        // 创建下拉框和选项
        String[] options = {"","男", "女"};
        t2 = new JComboBox<>(options);
        t2.setPreferredSize(new Dimension(138, t2.getPreferredSize().height));
        j2.add(l2);
        j2.add(t2);
        add(j2);

        j3=new JPanel();
        l3=new JLabel("联系电话");
        t_phone =new JTextField(15);
        j3.add(l3);
        j3.add(t_phone);
        add(j3);

        j4=new JPanel();
        l4=new JLabel("输入密码");
        t4=new JPasswordField(15);
        j4.add(l4);
        j4.add(t4);
        add(j4);

        j5=new JPanel();
        l5=new JLabel("确认密码");
        t5=new JPasswordField(15);
        j5.add(l5);
        j5.add(t5);
        add(j5);

        j6=new JPanel();
        b1=new JButton("注册");
        b2=new JButton("返回");
        j6.add(b1);
        j6.add(b2);
        add(j6);
    }
    public JTextField getT_name() {
        return t_name;
    }
    public JComboBox<String> getT2() {
        return t2;
    }
    public JTextField getT_phone() {
        return t_phone;
    }
    public JPasswordField getT4() {
        return t4;
    }
    public JPasswordField getT5() {
        return t5;
    }
    public JButton getB1(){
        return b1;
    }
    public JButton getB2() {
        return b2;
    }
    public JTextField getT_id() {return t_id;}

}
